






namespace RouteTiming.SLClient.Web
{
	using System;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.ComponentModel.DataAnnotations;
	using System.Linq;
	using System.ServiceModel;
	using System.ServiceModel.DomainServices.Client;
	using System.ServiceModel.DomainServices.Client.ApplicationServices;
	public sealed partial class AuthenticationContext : global::System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationDomainContextBase
	{
		public AuthenticationContext() : 
			this(new WebDomainClient<IAuthenticationServiceContract>(new Uri("RouteTiming-SLClient-Web-AuthenticationService.svc", UriKind.Relative)))
		{
		}
				
		public AuthenticationContext(Uri serviceUri) : 
			this(new WebDomainClient<IAuthenticationServiceContract>(serviceUri))
		{
		}
		
		public AuthenticationContext(DomainClient domainClient) :
			base(domainClient)
		{
			this.OnCreated();
		}
		protected override EntityContainer CreateEntityContainer()
		{
			return new AuthenticationContextEntityContainer();
		}
		internal sealed class AuthenticationContextEntityContainer : EntityContainer
		{
			public AuthenticationContextEntityContainer()
			{
				this.CreateEntitySet<RouteTiming.SLClient.Web.User>(EntitySetOperations.Edit);}
		}
		public EntityQuery<RouteTiming.SLClient.Web.User> GetUserQuery(
		)
		{
			this.ValidateMethod("GetUserQuery", null);
			return base.CreateQuery<RouteTiming.SLClient.Web.User>("GetUser", null, 
					false, false);
		}
		public EntityQuery<RouteTiming.SLClient.Web.User> LoginQuery(
		string userName, string password, bool isPersistent, string customData)
		{
			Dictionary<string, object> parameters = new Dictionary<string, object>();			
			parameters.Add("userName", userName);
			parameters.Add("password", password);
			parameters.Add("isPersistent", isPersistent);
			parameters.Add("customData", customData);
			this.ValidateMethod("LoginQuery", parameters);
			return base.CreateQuery<RouteTiming.SLClient.Web.User>("Login", parameters, 
					true, false);
		}
		public EntityQuery<RouteTiming.SLClient.Web.User> LogoutQuery(
		)
		{
			this.ValidateMethod("LogoutQuery", null);
			return base.CreateQuery<RouteTiming.SLClient.Web.User>("Logout", null, 
					true, false);
		}
		public EntitySet<RouteTiming.SLClient.Web.User> Users
		{
		    get
		    {
		        return base.EntityContainer.GetEntitySet<RouteTiming.SLClient.Web.User>();
		    }
		}
		[System.ServiceModel.ServiceContract()]
		public interface IAuthenticationServiceContract
		{
			[System.ServiceModel.Web.WebGet]
			[FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/GetUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
			[OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/GetUser", ReplyAction="http://tempuri.org/AuthenticationService/GetUserResponse")]	
			System.IAsyncResult BeginGetUser(
			System.AsyncCallback callback, object asyncState);
					
			System.ServiceModel.DomainServices.Client.QueryResult<RouteTiming.SLClient.Web.User> EndGetUser(System.IAsyncResult result);
			[FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/LoginDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
			[OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/Login", ReplyAction="http://tempuri.org/AuthenticationService/LoginResponse")]	
			System.IAsyncResult BeginLogin(
			string userName,
			string password,
			bool isPersistent,
			string customData,
			System.AsyncCallback callback, object asyncState);
					
			System.ServiceModel.DomainServices.Client.QueryResult<RouteTiming.SLClient.Web.User> EndLogin(System.IAsyncResult result);
			[FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/LogoutDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
			[OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/Logout", ReplyAction="http://tempuri.org/AuthenticationService/LogoutResponse")]	
			System.IAsyncResult BeginLogout(
			System.AsyncCallback callback, object asyncState);
					
			System.ServiceModel.DomainServices.Client.QueryResult<RouteTiming.SLClient.Web.User> EndLogout(System.IAsyncResult result);
			[FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/AuthenticationService/SubmitChangesDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
			[OperationContract(AsyncPattern=true, Action="http://tempuri.org/AuthenticationService/SubmitChanges", ReplyAction="http://tempuri.org/AuthenticationService/SubmitChangesResponse")]	
			IAsyncResult BeginSubmitChanges(IEnumerable<ChangeSetEntry> changeSet, AsyncCallback callback, object asyncState);
			IEnumerable<ChangeSetEntry> EndSubmitChanges(IAsyncResult result);			
		}
				
		partial void OnCreated();
	}
}






namespace RouteTiming.SLClient.Web
{
	[System.Runtime.Serialization.DataContract(Namespace = "http://schemas.datacontract.org/2004/07/RouteTiming.SLClient.Web")]
	public sealed partial class User : System.ServiceModel.DomainServices.Client.Entity, global::System.Security.Principal.IIdentity, global::System.Security.Principal.IPrincipal
	{
		// ctor
		public User()
		{
			this.OnCreated();
		}
		// end of ctor
		[System.Runtime.Serialization.DataMemberAttribute()]
		public string FriendlyName
		{
			get
			{
				return this._friendlyName;
			} 
			set 
			{
				if(this._friendlyName != value)
				{
					this.OnFriendlyNameChanging(value);	
					this.RaiseDataMemberChanging("FriendlyName");
					this.ValidateProperty("FriendlyName", value);
					this._friendlyName = value;
					this.RaiseDataMemberChanged("FriendlyName");
					this.OnFriendlyNameChanged();
				}
			}
		}
		private string _friendlyName;
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.EditableAttribute(false, AllowInitialValue=true)]
		[System.ComponentModel.DataAnnotations.KeyAttribute()]
		[System.ComponentModel.DataAnnotations.RoundtripOriginalAttribute()]
		public string Name
		{
			get
			{
				return this._name;
			} 
			set 
			{
				if(this._name != value)
				{
					this.OnNameChanging(value);	
					this.ValidateProperty("Name", value);
					this._name = value;
					this.RaisePropertyChanged("Name");
					this.OnNameChanged();
				}
			}
		}
		private string _name;
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.EditableAttribute(false)]
		public System.Collections.Generic.IEnumerable<string> Roles
		{
			get
			{
				return this._roles;
			} 
			set 
			{
				if(this._roles != value)
				{
					this.OnRolesChanging(value);	
					this.ValidateProperty("Roles", value);
					this._roles = value;
					this.RaisePropertyChanged("Roles");
					this.OnRolesChanged();
				}
			}
		}
		private System.Collections.Generic.IEnumerable<string> _roles;
		public override object GetIdentity()
		{
			return this._name;
		}
		partial void OnCreated();
		partial void OnFriendlyNameChanging(string value);
		partial void OnFriendlyNameChanged();
		partial void OnNameChanging(string value);
		partial void OnNameChanged();
		partial void OnRolesChanging(System.Collections.Generic.IEnumerable<string> value);
		partial void OnRolesChanged();
		string global::System.Security.Principal.IIdentity.AuthenticationType
		{
		    get
		    {
		        return string.Empty;
		    }
		}
		
		public bool IsAuthenticated
		{
		    get
		    {
		        return (true != string.IsNullOrEmpty(this.Name));
		    }
		}
		
		string global::System.Security.Principal.IIdentity.Name
		{
		    get
		    {
		        return this.Name;
		    }
		}
		
		global::System.Security.Principal.IIdentity global::System.Security.Principal.IPrincipal.Identity
		{
		    get
		    {
		        return this;
		    }
		}
		
		public bool IsInRole(string role)
		{
		    if ((this.Roles == null))
		    {
		        return false;
		    }
		    return global::System.Linq.Enumerable.Contains(this.Roles, role);
		}
	}
}







namespace RouteTiming.SLClient.Web
{
	using System;
	using System.Collections.Generic;
	using System.ComponentModel;
	using System.ComponentModel.DataAnnotations;
	using System.Linq;
	using System.ServiceModel;
	using System.ServiceModel.DomainServices.Client;
	using System.ServiceModel.DomainServices.Client.ApplicationServices;
	public sealed partial class UserRegistrationContext : System.ServiceModel.DomainServices.Client.DomainContext
	{
		public UserRegistrationContext() : 
			this(new WebDomainClient<IUserRegistrationServiceContract>(new Uri("RouteTiming-SLClient-Web-UserRegistrationService.svc", UriKind.Relative)))
		{
		}
				
		public UserRegistrationContext(Uri serviceUri) : 
			this(new WebDomainClient<IUserRegistrationServiceContract>(serviceUri))
		{
		}
		
		public UserRegistrationContext(DomainClient domainClient) :
			base(domainClient)
		{
			this.OnCreated();
		}
		protected override EntityContainer CreateEntityContainer()
		{
			return new UserRegistrationContextEntityContainer();
		}
		internal sealed class UserRegistrationContextEntityContainer : EntityContainer
		{
			public UserRegistrationContextEntityContainer()
			{
			}
		}
		public InvokeOperation<RouteTiming.SLClient.Web.CreateUserStatus> CreateUser(
		RouteTiming.SLClient.Web.RegistrationData user, [System.ComponentModel.DataAnnotations.RegularExpressionAttribute(@"^.*[^a-zA-Z0-9].*$", ErrorMessageResourceName=@"ValidationErrorBadPasswordStrength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessageResourceName=@"ValidationErrorRequiredField",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.StringLengthAttribute(50, ErrorMessageResourceName=@"ValidationErrorBadPasswordLength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources),MinimumLength=7)]
		string password, Action<InvokeOperation<RouteTiming.SLClient.Web.CreateUserStatus>> callback, object userState
		)
		{
			Dictionary<string, object> parameters = new Dictionary<string, object>();			
			parameters.Add("user", user);
			parameters.Add("password", password);
			this.ValidateMethod("CreateUser", parameters);
			return ((InvokeOperation<RouteTiming.SLClient.Web.CreateUserStatus>)(this.InvokeOperation("CreateUser", typeof(RouteTiming.SLClient.Web.CreateUserStatus), parameters, 
			true,
			callback, userState)));
		}
		public InvokeOperation<RouteTiming.SLClient.Web.CreateUserStatus> CreateUser(
		RouteTiming.SLClient.Web.RegistrationData user, [System.ComponentModel.DataAnnotations.RegularExpressionAttribute(@"^.*[^a-zA-Z0-9].*$", ErrorMessageResourceName=@"ValidationErrorBadPasswordStrength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessageResourceName=@"ValidationErrorRequiredField",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.StringLengthAttribute(50, ErrorMessageResourceName=@"ValidationErrorBadPasswordLength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources),MinimumLength=7)]
		string password)
		{
			Dictionary<string, object> parameters = new Dictionary<string, object>();			
			parameters.Add("user", user);
			parameters.Add("password", password);
			this.ValidateMethod("CreateUser", parameters);
			return ((InvokeOperation<RouteTiming.SLClient.Web.CreateUserStatus>)(this.InvokeOperation("CreateUser", typeof(RouteTiming.SLClient.Web.CreateUserStatus), parameters, 
			true,
			null, null)));
		}
		[System.ServiceModel.ServiceContract()]
		public interface IUserRegistrationServiceContract
		{
			[FaultContract(typeof(DomainServiceFault), Action="http://tempuri.org/UserRegistrationService/CreateUserDomainServiceFault", Name="DomainServiceFault", Namespace="DomainServices")]
			[OperationContract(AsyncPattern=true, Action="http://tempuri.org/UserRegistrationService/CreateUser", ReplyAction="http://tempuri.org/UserRegistrationService/CreateUserResponse")]	
			System.IAsyncResult BeginCreateUser(
			RouteTiming.SLClient.Web.RegistrationData user,
			string password,
			System.AsyncCallback callback, object asyncState);
					
			RouteTiming.SLClient.Web.CreateUserStatus EndCreateUser(System.IAsyncResult result);
		}
				
		partial void OnCreated();
	}
}






namespace RouteTiming.SLClient.Web
{
	[System.Runtime.Serialization.DataContract(Namespace = "http://schemas.datacontract.org/2004/07/RouteTiming.SLClient.Web")]
	public sealed partial class RegistrationData : System.ServiceModel.DomainServices.Client.ComplexObject
	{
		public RegistrationData()
		{
			this.OnCreated();
		}
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.DisplayAttribute(Name=@"SecurityAnswerLabel",Order=6,ResourceType=typeof(RouteTiming.SLClient.Web.Resources.RegistrationDataResources))]
		[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessageResourceName=@"ValidationErrorRequiredField",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.StringLengthAttribute(128, ErrorMessageResourceName=@"ValidationErrorBadAnswerLength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		public string Answer
		{
			get
			{
				return this._answer;
			} 
			set 
			{
				if(this._answer != value)
				{
					this.OnAnswerChanging(value);	
					this.RaiseDataMemberChanging("Answer");
					this.ValidateProperty("Answer", value);
					this._answer = value;
					this.RaiseDataMemberChanged("Answer");
					this.OnAnswerChanged();
				}
			}
		}
		private string _answer;
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.DisplayAttribute(Name=@"EmailLabel",Order=2,ResourceType=typeof(RouteTiming.SLClient.Web.Resources.RegistrationDataResources))]
		[System.ComponentModel.DataAnnotations.RegularExpressionAttribute(@"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$", ErrorMessageResourceName=@"ValidationErrorInvalidEmail",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessageResourceName=@"ValidationErrorRequiredField",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		public string Email
		{
			get
			{
				return this._email;
			} 
			set 
			{
				if(this._email != value)
				{
					this.OnEmailChanging(value);	
					this.RaiseDataMemberChanging("Email");
					this.ValidateProperty("Email", value);
					this._email = value;
					this.RaiseDataMemberChanged("Email");
					this.OnEmailChanged();
				}
			}
		}
		private string _email;
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.DisplayAttribute(Description=@"FriendlyNameDescription",Name=@"FriendlyNameLabel",Order=1,ResourceType=typeof(RouteTiming.SLClient.Web.Resources.RegistrationDataResources))]
		[System.ComponentModel.DataAnnotations.StringLengthAttribute(255, ErrorMessageResourceName=@"ValidationErrorBadFriendlyNameLength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		public string FriendlyName
		{
			get
			{
				return this._friendlyName;
			} 
			set 
			{
				if(this._friendlyName != value)
				{
					this.OnFriendlyNameChanging(value);	
					this.RaiseDataMemberChanging("FriendlyName");
					this.ValidateProperty("FriendlyName", value);
					this._friendlyName = value;
					this.RaiseDataMemberChanged("FriendlyName");
					this.OnFriendlyNameChanged();
				}
			}
		}
		private string _friendlyName;
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.DisplayAttribute(Name=@"SecurityQuestionLabel",Order=5,ResourceType=typeof(RouteTiming.SLClient.Web.Resources.RegistrationDataResources))]
		[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessageResourceName=@"ValidationErrorRequiredField",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		public string Question
		{
			get
			{
				return this._question;
			} 
			set 
			{
				if(this._question != value)
				{
					this.OnQuestionChanging(value);	
					this.RaiseDataMemberChanging("Question");
					this.ValidateProperty("Question", value);
					this._question = value;
					this.RaiseDataMemberChanged("Question");
					this.OnQuestionChanged();
				}
			}
		}
		private string _question;
		[System.Runtime.Serialization.DataMemberAttribute()]
		[System.ComponentModel.DataAnnotations.DisplayAttribute(Name=@"UserNameLabel",Order=0,ResourceType=typeof(RouteTiming.SLClient.Web.Resources.RegistrationDataResources))]
		[System.ComponentModel.DataAnnotations.RegularExpressionAttribute(@"^[a-zA-Z0-9_]*$", ErrorMessageResourceName=@"ValidationErrorInvalidUserName",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.RequiredAttribute(ErrorMessageResourceName=@"ValidationErrorRequiredField",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources))]
		[System.ComponentModel.DataAnnotations.StringLengthAttribute(255, ErrorMessageResourceName=@"ValidationErrorBadUserNameLength",ErrorMessageResourceType=typeof(RouteTiming.SLClient.Web.Resources.ValidationErrorResources),MinimumLength=4)]
		public string UserName
		{
			get
			{
				return this._userName;
			} 
			set 
			{
				if(this._userName != value)
				{
					this.OnUserNameChanging(value);	
					this.RaiseDataMemberChanging("UserName");
					this.ValidateProperty("UserName", value);
					this._userName = value;
					this.RaiseDataMemberChanged("UserName");
					this.OnUserNameChanged();
				}
			}
		}
		private string _userName;
		partial void OnCreated();
		partial void OnAnswerChanging(string value);
		partial void OnAnswerChanged();
		partial void OnEmailChanging(string value);
		partial void OnEmailChanged();
		partial void OnFriendlyNameChanging(string value);
		partial void OnFriendlyNameChanged();
		partial void OnQuestionChanging(string value);
		partial void OnQuestionChanged();
		partial void OnUserNameChanging(string value);
		partial void OnUserNameChanged();
	}
}





namespace RouteTiming.SLClient
{
	public sealed partial class WebContext : System.ServiceModel.DomainServices.Client.ApplicationServices.WebContextBase
	{
		public WebContext()
		{			
			this.OnCreated();
		}
		partial void OnCreated();
		public new static WebContext Current
		{
		    get
		    {
		        return ((WebContext)(System.ServiceModel.DomainServices.Client.ApplicationServices.WebContextBase.Current));
		    }
		}
		public new RouteTiming.SLClient.Web.User User
		{
			get { return (RouteTiming.SLClient.Web.User)base.User; }
		}
	}
}






namespace RouteTiming.SLClient.Web{
	public enum CreateUserStatus{
		 
		Success = 0 , 
		InvalidUserName = 1 , 
		InvalidPassword = 2 , 
		InvalidQuestion = 3 , 
		InvalidAnswer = 4 , 
		InvalidEmail = 5 , 
		DuplicateUserName = 6 , 
		DuplicateEmail = 7 , 
		Failure = 8 }
}

